@import './vars.less';

// 重写button样式
.ant_btn_reset() {
  /deep/ .ant-btn:hover {
    color: @text-color  !important;
  }

  /deep/ .ant-btn:focus {
    color: @text-color  !important;
  }
}

// 重写input样式
.ant_input_reset() {
  /deep/ .ant-input {
    background-color: transparent;
  }

  /deep/ .ant-input-disabled {
    color: @dark-color-6;
  }
}

// 重写select样式
.ant_select_reset() {
  /deep/ .ant-select-selection {
    background-color: transparent;
  }

  /deep/ .ant-select-arrow {
    color: white;
  }
}

// 重写slider样式
.ant_slider_reset() {
  /deep/ .ant-slider-rail {
    background-color: white;
  }

  /deep/ .ant-slider-track {
    background-color: @primary-color;
  }

  /deep/ .ant-slider-handle {
    background-color: @primary-color;
    border-color: @primary-color;
  }
}

// 重写popconfirm样式
.ant_popconfirm_reset() {
  .ant-popover {
    .ant-popover-arrow {
      border-color: @primary-color  !important;
    }

    .ant-popover-inner {
      background-color: @primary-color;

      .ant-popover-buttons .ant-btn {
        color: lighten(@dark-color, 99.9% - lightness(@dark-color));
        background: transparent;
        border: none;
        font-size: 12px;

        &.ant-btn-primary {
          border: 1px solid lighten(@dark-color, 99.9% - lightness(@dark-color));
        }
      }
    }

    &.popconfirm-delete {
      .ant-popover-buttons {
        display: none;
      }

      .ant-popover-message {
        padding: 4px 0 0 0;
      }
    }
  }
}

// 重写pagination样式
.ant_pagination_reset() {
  /deep/ .ant-pagination {
    .ant-pagination-item-active a {
      background: @primary-color;
      color: lighten(@dark-color, 99.9% - lightness(@dark-color));
    }

    .ant-pagination-item-ellipsis {
      color: lighten(@dark-color, 99.9% - lightness(@dark-color));
    }
  }
}

// 重写checkbox样式
.ant_checkbox_reset() {
  /deep/ .ant-checkbox-inner {
    background-color: transparent;
  }
}

// 重写collapse样式
.ant_collapse_reset() {
  /deep/ .ant-collapse {
    .ant-collapse-item {
      .ant-modal-close {
        .ant-modal-close-icon {
          color: white;
        }
      }

      .ant-collapse-content {
        background-color: @dark-color-5;
      }

    }

  }
}

// 重写table样式
.ant_table_reset() {
  /deep/ .ant-table {
    background-color: transparent;
    border: 1px solid @dark-color-5;
    border-radius: 0.25rem;

    .ant-table-row-selected {
      td {
        background-color: transparent;
      }
    }

    .ant-table-placeholder {
      background-color: transparent;

      .ant-empty-description {
        color: white;
      }
    }

    .ant-table-thead {
      th {
        background-color: @dark-color-4;
      }
    }

    .ant-table-selection-column {
      .ant-checkbox-inner {
        border-color: @dark-color-6;
        background-color: transparent;
      }
    }

    .ant-table-tbody .ant-table-row:nth-child(odd) {
      background-color: transparent;
    }

    .ant-table-tbody .ant-table-row:nth-child(even) {
      background: @dark-color-4;
    }
  }
}

// 重写modal样式
.ant_modal_reset() {
  /deep/ .ant-modal-content {
    background-color: @dark-color-3;

    .ant-modal-header {
      background-color: inherit;
    }
  }

}

// 重写message样式
.ant_message_reset(@name, @bgColor) {
  .@{name} {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    color: white;
    font-size: 14px;
    font-variant: tabular-nums;
    line-height: 1.5;
    list-style: none;
    font-feature-settings: 'tnum';
    position: fixed;
    top: 16px;
    left: 0;
    z-index: 1010;
    width: 100%;
    pointer-events: none;
  }
  .@{name}-notice {
    padding: 8px;
    text-align: center;
  }
  .@{name}-notice:first-child {
    margin-top: -8px;
  }
  .@{name}-notice-content {
    display: inline-block;
    padding: 10px 16px;
    background: @bgColor;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: all;
  }
  .@{name} .anticon {
    color: fff;
    position: relative;
    top: 1px;
    margin-right: 8px;
    font-size: 16px;
  }
  .@{name}-notice.move-up-leave.move-up-leave-active {
    overflow: hidden;
    -webkit-animation-name: MessageMoveOut;
            animation-name: MessageMoveOut;
    -webkit-animation-duration: 0.3s;
            animation-duration: 0.3s;
  }
  @-webkit-keyframes MessageMoveOut {
    0% {
      max-height: 150px;
      padding: 8px;
      opacity: 1;
    }
    100% {
      max-height: 0;
      padding: 0;
      opacity: 0;
    }
  }
  @keyframes MessageMoveOut {
    0% {
      max-height: 150px;
      padding: 8px;
      opacity: 1;
    }
    100% {
      max-height: 0;
      padding: 0;
      opacity: 0;
    }
  }
}